<script setup lang="ts">
import { computed } from '@vue/reactivity'
import { ref } from 'vue'

const count = ref<number>(99)

const doubleCount = computed<number>(() => {
  return count.value * 2
})

// e: MouseEvent => 写错单词会报错; 也有属性提示
const add = (e: MouseEvent) => {
  console.log(e.pageX, e.pageY)
  count.value++
}
</script>

<template>
  <div>app组件 -- {{ count }} -- {{ doubleCount }}</div>
  <button @click="add($event)">+1</button>
</template>

<style></style>
